Python Nested while loop tutorial